package com.yj.consumer.dynamicDataSource;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.security.RolesAllowed;

@Component
@Slf4j
public class CommonRun implements CommandLineRunner {

    @Autowired
    UserService userService;

    @Autowired
    RoleService roleService;


    @Override
    public void run(String... args) throws Exception {
      log.info("local_db-->list {}",userService.findAll());
      log.info("remote_db-->list {}",roleService.findAll());
    }
}
